package com.chengma.service.impl;

import java.util.Date;
import java.util.List;

import com.chengma.domain.TbUserVisitedQuestion;
import com.chengma.mapper.TbUserVisitedQuestionMapper;
import com.chengma.service.ITbUserVisitedQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 用户浏览问题记录Service业务层处理
 * 
 * @author tck
 * @date 2025-03-19
 */
@Service
public class TbUserVisitedQuestionServiceImpl implements ITbUserVisitedQuestionService
{
    @Autowired
    private TbUserVisitedQuestionMapper tbUserVisitedQuestionMapper;

    /**
     * 查询用户浏览问题记录
     * 
     * @param id 用户浏览问题记录主键
     * @return 用户浏览问题记录
     */
    @Override
    public TbUserVisitedQuestion selectTbUserVisitedQuestionById(Long id)
    {
        return tbUserVisitedQuestionMapper.selectTbUserVisitedQuestionById(id);
    }

    /**
     * 查询用户浏览问题记录列表
     * 
     * @param tbUserVisitedQuestion 用户浏览问题记录
     * @return 用户浏览问题记录
     */
    @Override
    public List<TbUserVisitedQuestion> selectTbUserVisitedQuestionList(TbUserVisitedQuestion tbUserVisitedQuestion)
    {
        return tbUserVisitedQuestionMapper.selectTbUserVisitedQuestionList(tbUserVisitedQuestion);
    }

    /**
     * 新增用户浏览问题记录
     * 
     * @param tbUserVisitedQuestion 用户浏览问题记录
     * @return 结果
     */
    @Override
    public int insertTbUserVisitedQuestion(TbUserVisitedQuestion tbUserVisitedQuestion)
    {
        tbUserVisitedQuestion.setCreateTime(new Date());
        return tbUserVisitedQuestionMapper.insertTbUserVisitedQuestion(tbUserVisitedQuestion);
    }

    /**
     * 修改用户浏览问题记录
     * 
     * @param tbUserVisitedQuestion 用户浏览问题记录
     * @return 结果
     */
    @Override
    public int updateTbUserVisitedQuestion(TbUserVisitedQuestion tbUserVisitedQuestion)
    {
        return tbUserVisitedQuestionMapper.updateTbUserVisitedQuestion(tbUserVisitedQuestion);
    }

    /**
     * 批量删除用户浏览问题记录
     * 
     * @param ids 需要删除的用户浏览问题记录主键
     * @return 结果
     */
    @Override
    public int deleteTbUserVisitedQuestionByIds(Long[] ids)
    {
        return tbUserVisitedQuestionMapper.deleteTbUserVisitedQuestionByIds(ids);
    }

    /**
     * 删除用户浏览问题记录信息
     * 
     * @param id 用户浏览问题记录主键
     * @return 结果
     */
    @Override
    public int deleteTbUserVisitedQuestionById(Long id)
    {
        return tbUserVisitedQuestionMapper.deleteTbUserVisitedQuestionById(id);
    }
}
